package org.raymond.iworks.study.basic.designpattern.chain;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class Client {
    public static void main(String[] args) {
        PurchaseRequest request = new PurchaseRequest(1, 1000, 1);
        Approver departmentApprover = new DepartmentApprover("张主任");
        Approver collegeApprover = new CollegeApprover("李院长");
        Approver viceSchoolMasterApprover = new ViceSchoolMasterApprover("王副校长");
        Approver schoolMasterApprover = new SchoolMasterApprover("袁校长");

        departmentApprover.setApprover(collegeApprover);
        collegeApprover.setApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setApprover(schoolMasterApprover);
        // 审批人需要构成环形
        schoolMasterApprover.setApprover(departmentApprover);

        departmentApprover.purchaseRequest(request);
    }
}
